import re

def convert_time_to_seconds(time_input):
    # 使用正则表达式匹配不同单位的时间值
    pattern = r'(\d+)\s*(天|小时|分|秒)?'
    matches = re.findall(pattern, time_input)

    # 定义时间单位与对应的秒数
    unit_seconds = {
        '天': 86400,
        '小时': 3600,
        '分': 60,
        '秒': 1
    }

    # 计算总的秒数
    total_seconds = 0

    for match in matches:
        value, unit = match
        value = int(value)

        if unit:
            total_seconds += value * unit_seconds[unit]

    return total_seconds
